function [a,b,c,d,e]=homework4(options,power)

%max_rate_precode, equal_snr_precode, linear_mmse_precode, whitening_precode
if(nargin<1)
options=[1 2 3 4 5];
power=10;	%total power being transmitted
end


noise=1;	%noise at each receiver
rho=power/noise;
correl1=0.3;
sample_words={'Hello World' 'whats up doc' 'gone fishin' '867-5309 Jenny' 'Twilight zone' 'random word2007' 'myemail@address.com', 'moreworrds', 'somemisspelled', 'JUST TESTING', 'unitary_group_code', 'xklqapksad'}; 

word=char(sample_words(ceil(rand()*length(sample_words))));

training=20;
n=4;

[s,byte_sequence]=transmit_qpsk_gray(word2bin(word),n);
h_corr=correlated_channel(n,n,correl1,correl1);
h_uncorr=correlated_channel(n,n,0,0);
v=noise*randn(n,1) + j*noise*randn(n,1);
h_corr_hat=channel_estimation(h_corr,noise,rho,n,n,training,v);
h_uncorr_hat=channel_estimation(h_uncorr,noise,rho,n,n,training,v);

if(length(find(options==1)) > 0)
a(1)=blast_accuracy(byte_sequence,hw4_director(1,h_corr,h_corr,s,v,noise,rho,n,n));
a(2)=blast_accuracy(byte_sequence,hw4_director(1,h_uncorr,h_uncorr,s,v,noise,rho,n,n));
a(3)=blast_accuracy(byte_sequence,hw4_director(1,h_corr,h_corr_hat,s,v,noise,rho,n,n));
a(4)=blast_accuracy(byte_sequence,hw4_director(1,h_uncorr,h_uncorr_hat,s,v,noise,rho,n,n));
else
a=0;
end

if(length(find(options==2)) > 0)
b(1)=blast_accuracy(byte_sequence,hw4_director(2,h_corr,h_corr,s,v,noise,rho,n,n));
b(2)=blast_accuracy(byte_sequence,hw4_director(2,h_uncorr,h_uncorr,s,v,noise,rho,n,n));
b(3)=blast_accuracy(byte_sequence,hw4_director(2,h_corr,h_corr_hat,s,v,noise,rho,n,n));
b(4)=blast_accuracy(byte_sequence,hw4_director(2,h_uncorr,h_uncorr_hat,s,v,noise,rho,n,n));
else
b=0;
end

if(length(find(options==3)) > 0)
c(1)=blast_accuracy(byte_sequence,hw4_director(3,h_corr,h_corr,s,v,noise,rho,n,n));
c(2)=blast_accuracy(byte_sequence,hw4_director(3,h_uncorr,h_uncorr,s,v,noise,rho,n,n));
c(3)=blast_accuracy(byte_sequence,hw4_director(3,h_corr,h_corr_hat,s,v,noise,rho,n,n));
c(4)=blast_accuracy(byte_sequence,hw4_director(3,h_uncorr,h_uncorr_hat,s,v,noise,rho,n,n));
else
c=0;
end

if(length(find(options==4)) > 0)
d(1)=blast_accuracy(byte_sequence,hw4_director(4,h_corr,h_corr,s,v,noise,rho,n,n));
d(2)=blast_accuracy(byte_sequence,hw4_director(4,h_uncorr,h_uncorr,s,v,noise,rho,n,n));
d(3)=blast_accuracy(byte_sequence,hw4_director(4,h_corr,h_corr_hat,s,v,noise,rho,n,n));
d(4)=blast_accuracy(byte_sequence,hw4_director(4,h_uncorr,h_uncorr_hat,s,v,noise,rho,n,n));
else
d=0;
end

if(length(find(options==1)) > 0)
e(1)=blast_accuracy(byte_sequence,blast_detection(1,h_corr,h_corr,s,noise,v,rho,n));
e(2)=blast_accuracy(byte_sequence,blast_detection(1,h_uncorr,h_uncorr,s,noise,v,rho,n));
e(3)=blast_accuracy(byte_sequence,blast_detection(1,h_corr,h_corr_hat,s,noise,v,rho,n));
e(4)=blast_accuracy(byte_sequence,blast_detection(1,h_uncorr,h_uncorr_hat,s,noise,v,rho,n));
else
e=0;
end